# $Id: PKGBUILD 179886 2013-03-10 20:05:04Z guillaume $
# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>

pkgname=eclipse-ecj
pkgver=4.2.2
pkgrel=1
_date=201302041200
pkgdesc='Eclipse java bytecode compiler'
arch=('any')
license=('EPL')
url='http://www.eclipse.org/'
depends=('java-runtime')
makedepends=('apache-ant' 'java-environment')
source=(http://download.eclipse.org/eclipse/downloads/drops4/R-${pkgver}-${_date}/ecjsrc-${pkgver}.jar
        01-ecj-include-props.patch
        ecj)
sha256sums=('95097ba9418cbdc309ce2f2f915ea2486fd2e26b813eaceb6090c5551b96c019'
            '8f6259c76dfe493549bbaec3c8a7ba29e82c70e127c918adca28737dcb570f6b'
            '63aff3d126243d303ddc4305cfa77827df72e87ccf85bd8a22a2f832357e396c')

build() {
  cd ${srcdir}
  patch -p0 < 01-ecj-include-props.patch
  ant build
}

package() {
  install -Dm644 ${srcdir}/ecj.jar ${pkgdir}/usr/share/java/eclipse-ecj-${pkgver}.jar
  ln -s eclipse-ecj-${pkgver}.jar ${pkgdir}/usr/share/java/ecj.jar
  ln -s eclipse-ecj-${pkgver}.jar ${pkgdir}/usr/share/java/eclipse-ecj.jar
  install -Dm755 ecj ${pkgdir}/usr/bin/ecj
}
